<?php
/**
 * Created by PhpStorm.
 * User: s.utkin
 * Date: 26.08.14
 * Time: 16:03
 */

namespace Messenger;



class MessagesCountAction extends BaseAction {
	protected static $isPublic = true;
	
    /**
     * Отображает в меню количество новых сообщений пользователю
     */
    protected function run()
    {
        $targetProfileId = trim($this->request->targetProfileId);

		$count = Groups::getUnreadMessagesCountForProfile($targetProfileId);

        $this->response->count = $count;
    }
}